home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 3747 < prev    next >
Encoding:
Text File  |  1996-08-06  |  1.6 KB  |  63 lines

  1. Path: newsfeed.internetmci.com!xmission!news
  2. From: Larry C Sanders <sanders@xmission.com>
  3. Newsgroups: comp.lang.c++
  4. Subject: Borland 4.5 -- WARN macro works in DOS but not Windows???
  5. Date: Thu, 25 Jan 1996 15:29:24 -0800
  6. Organization: XMission Internet (801 539 0900)
  7. Message-ID: <31081254.39F2@xmission.com>
  8. NNTP-Posting-Host: parkc2.xmission.com
  9. Mime-Version: 1.0
  10. Content-Type: text/plain; charset=us-ascii
  11. Content-Transfer-Encoding: 7bit
  12. X-Mailer: Mozilla 2.0b5 (Win95; I; 16bit)
  13.  
  14. Using a Borland 4.5 compiler I was surprised that the CHECK, TRACE, WARN 
  15. ..etc
  16. macros do not work when compiled as an EasyWin executable.
  17.  
  18. In the Borland 'Library Reference' it says "These macros can be used
  19. with Windows and DOS and ..."
  20.  
  21. But for me -- no joy in the windows case.  Can anyone help?
  22. Here is the test code:
  23.  
  24. #include <stdio.h>
  25. #include <checks.h>
  26. #include <stdio.h>
  27. #include <checks.h>
  28. #include <assert.h>
  29.  
  30. int main(){
  31.     printf("Hello World\n");
  32.     TRACE("Hello World");
  33.     WARN(5 != 5, "Math is broken");
  34.     WARN(5 != 7, "Math still works");
  35.  
  36.     printf("Goodbye World\n");
  37.     assert(0);
  38.  
  39.     return(0);
  40. }
  41.  
  42.  
  43. Complile and run this as a dos.exe and see this output:
  44.  
  45. Hello World
  46. Trace WARN.CPP 7:[Def] Hello World
  47. Warning WARN.CPP 9:[Def] Math still works
  48. Goodbye World
  49. Assertion failed: 0, file WARN.CPP, line 12
  50. abnormal program termination
  51.  
  52.  
  53. Complile and run this as a EasyWin.exe and see this output:
  54.  
  55. Hello World
  56. Goodbye World
  57. Then a message dialog pops up with
  58.     "Assertion failed: 0, file WARN.CPP, line 12"
  59. When you clear that, another pops up "abnormal program termination"
  60.  
  61. What is missing is any indication that the TRACE or WARN statments 
  62. executed.
  63.